<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>Class Vec2i | HiAPI-C# 2025 </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="Class Vec2i | HiAPI-C# 2025 ">
      
      <meta name="description" content="Basic 2D point (or vector).">
      <link rel="icon" href="../img/HiAPI.favicon.ico">
      <link rel="stylesheet" href="../public/docfx.min.css">
      <link rel="stylesheet" href="../public/main.css">
      <meta name="docfx:navrel" content="../toc.html">
      <meta name="docfx:tocrel" content="toc.html">
      
      <meta name="docfx:rel" content="../">
      
      
      
      <meta name="loc:inThisArticle" content="In this article">
      <meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
      <meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
      <meta name="loc:tocFilter" content="Filter by title">
      <meta name="loc:nextArticle" content="Next">
      <meta name="loc:prevArticle" content="Previous">
      <meta name="loc:themeLight" content="Light">
      <meta name="loc:themeDark" content="Dark">
      <meta name="loc:themeAuto" content="Auto">
      <meta name="loc:changeTheme" content="Change theme">
      <meta name="loc:copy" content="Copy">
      <meta name="loc:downloadPdf" content="Download PDF">

      <script type="module" src="./../public/docfx.min.js"></script>

      <script>
        const theme = localStorage.getItem('theme') || 'auto'
        document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
      </script>

  </head>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
            
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="Hi.Geom.Vec2i">



  <h1 id="Hi_Geom_Vec2i" data-uid="Hi.Geom.Vec2i" class="text-break">
Class Vec2i  
  </h1>

  <div class="facts text-secondary">
    <dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.Geom.html">Geom</a></dd></dl>
  <dl><dt>Assembly</dt><dd>HiGeom.dll</dd></dl>
  </div>

  <div class="markdown summary"><p>Basic 2D point (or vector).</p>
</div>
  <div class="markdown conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class Vec2i : IEquatable&lt;Vec2i&gt;, IFormattable</code></pre>
  </div>




  <dl class="typelist inheritance">
    <dt>Inheritance</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
      <div><span class="xref">Vec2i</span></div>
    </dd>
  </dl>

  <dl class="typelist implements">
    <dt>Implements</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable</a>&lt;<a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a>&gt;</div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iformattable">IFormattable</a></div>
    </dd>
  </dl>


  <dl class="typelist inheritedMembers">
    <dt>Inherited Members</dt>
    <dd>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
    </div>
  </dd></dl>

  <dl class="typelist extensionMethods">
    <dt>Extension Methods</dt>
    <dd>
  <div>
      <a class="xref" href="Hi.Common.DuplicateUtil.html#Hi_Common_DuplicateUtil_TryDuplicate__1___0_System_Object___">DuplicateUtil.TryDuplicate&lt;TSelf&gt;(TSelf, params object[])</a>
  </div>
  <div>
      <a class="xref" href="Hi.Common.InvokeUtil.html#Hi_Common_InvokeUtil_SelfInvoke__1___0_System_Action___0__">InvokeUtil.SelfInvoke&lt;TSrc&gt;(TSrc, Action&lt;TSrc&gt;)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Common.InvokeUtil.html#Hi_Common_InvokeUtil_SelfInvoke__2___0_System_Func___0___1__">InvokeUtil.SelfInvoke&lt;TSrc, TDst&gt;(TSrc, Func&lt;TSrc, TDst&gt;)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Coloring.ColorUtil.html#Hi_Coloring_ColorUtil_GetGloomyColor_System_Object_System_Double_System_Double_">ColorUtil.GetGloomyColor(object, double, double)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Common.NameUtil.html#Hi_Common_NameUtil_GetSelectionName_System_Object_">NameUtil.GetSelectionName(object)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Common.StringUtil.html#Hi_Common_StringUtil_GetPropertyStringIfToStringNotOverloaded_System_Object_System_Boolean_System_Boolean_">StringUtil.GetPropertyStringIfToStringNotOverloaded(object, bool, bool)</a>
  </div>
  <div>
      <a class="xref" href="Hi.Parallels.LockUtil.html#Hi_Parallels_LockUtil_Lock_System_Object_">LockUtil.Lock(object)</a>
  </div>
  </dd></dl>





  <h2 class="section" id="constructors">Constructors
</h2>


  <a id="Hi_Geom_Vec2i__ctor_" data-uid="Hi.Geom.Vec2i.#ctor*"></a>

  <h3 id="Hi_Geom_Vec2i__ctor_Hi_Geom_Vec2i_" data-uid="Hi.Geom.Vec2i.#ctor(Hi.Geom.Vec2i)">
  Vec2i(Vec2i)
  
  </h3>

  <div class="markdown level1 summary"><p>Copy ctor.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i(Vec2i src)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>src</p>
</dd>
  </dl>












  <a id="Hi_Geom_Vec2i__ctor_" data-uid="Hi.Geom.Vec2i.#ctor*"></a>

  <h3 id="Hi_Geom_Vec2i__ctor_System_IO_BinaryReader_" data-uid="Hi.Geom.Vec2i.#ctor(System.IO.BinaryReader)">
  Vec2i(BinaryReader)
  
  </h3>

  <div class="markdown level1 summary"><p>Ctor by bytes:
x = reader.ReadDouble();
y = reader.ReadDouble();</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i(BinaryReader reader)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>reader</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.binaryreader">BinaryReader</a></dt>
    <dd><p>reader</p>
</dd>
  </dl>












  <a id="Hi_Geom_Vec2i__ctor_" data-uid="Hi.Geom.Vec2i.#ctor*"></a>

  <h3 id="Hi_Geom_Vec2i__ctor_System_Int32_System_Int32_" data-uid="Hi.Geom.Vec2i.#ctor(System.Int32,System.Int32)">
  Vec2i(int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Ctor.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i(int x = 0, int y = 0)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>x</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>x</p>
</dd>
    <dt><code>y</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>y</p>
</dd>
  </dl>












  <a id="Hi_Geom_Vec2i__ctor_" data-uid="Hi.Geom.Vec2i.#ctor*"></a>

  <h3 id="Hi_Geom_Vec2i__ctor_System_Int32_System_Int32_System_Int32_" data-uid="Hi.Geom.Vec2i.#ctor(System.Int32,System.Int32,System.Int32)">
  Vec2i(int, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Ctor by direction offset.
Direction 0,1 indicate x,y respectively.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i(int dir, int a, int b)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>dir</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>direction offset</p>
</dd>
    <dt><code>a</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>value at direction (0+dir)%3</p>
</dd>
    <dt><code>b</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>value at direction (1+dir)%3</p>
</dd>
  </dl>












  <a id="Hi_Geom_Vec2i__ctor_" data-uid="Hi.Geom.Vec2i.#ctor*"></a>

  <h3 id="Hi_Geom_Vec2i__ctor_System_String_" data-uid="Hi.Geom.Vec2i.#ctor(System.String)">
  Vec2i(string)
  
  </h3>

  <div class="markdown level1 summary"><p>Ctor by string. The format is (x,y).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i(string src)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>src</p>
</dd>
  </dl>












  <h2 class="section" id="fields">Fields
</h2>



  <h3 id="Hi_Geom_Vec2i_x" data-uid="Hi.Geom.Vec2i.x">
  x
  
  </h3>

  <div class="markdown level1 summary"><p>Value at x direction.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int x</code></pre>
  </div>




  <h4 class="section">Field Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>










  <h3 id="Hi_Geom_Vec2i_y" data-uid="Hi.Geom.Vec2i.y">
  y
  
  </h3>

  <div class="markdown level1 summary"><p>Value at y direction.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int y</code></pre>
  </div>




  <h4 class="section">Field Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>









  <h2 class="section" id="properties">Properties
</h2>


  <a id="Hi_Geom_Vec2i_AbsSum_" data-uid="Hi.Geom.Vec2i.AbsSum*"></a>

  <h3 id="Hi_Geom_Vec2i_AbsSum" data-uid="Hi.Geom.Vec2i.AbsSum">
  AbsSum
  
  </h3>

  <div class="markdown level1 summary"><p>Sum of abs(x) and abs(y).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int AbsSum { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Geom_Vec2i_LengthSquare_" data-uid="Hi.Geom.Vec2i.LengthSquare*"></a>

  <h3 id="Hi_Geom_Vec2i_LengthSquare" data-uid="Hi.Geom.Vec2i.LengthSquare">
  LengthSquare
  
  </h3>

  <div class="markdown level1 summary"><p>Length square.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int LengthSquare { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Geom_Vec2i_Max_" data-uid="Hi.Geom.Vec2i.Max*"></a>

  <h3 id="Hi_Geom_Vec2i_Max" data-uid="Hi.Geom.Vec2i.Max">
  Max
  
  </h3>

  <div class="markdown level1 summary"><p>Get max value from {x,y}.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int Max { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Geom_Vec2i_MaxAbsDir_" data-uid="Hi.Geom.Vec2i.MaxAbsDir*"></a>

  <h3 id="Hi_Geom_Vec2i_MaxAbsDir" data-uid="Hi.Geom.Vec2i.MaxAbsDir">
  MaxAbsDir
  
  </h3>

  <div class="markdown level1 summary"><p>Get the direction of the max absolute value.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int MaxAbsDir { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Geom_Vec2i_MaxDir_" data-uid="Hi.Geom.Vec2i.MaxDir*"></a>

  <h3 id="Hi_Geom_Vec2i_MaxDir" data-uid="Hi.Geom.Vec2i.MaxDir">
  MaxDir
  
  </h3>

  <div class="markdown level1 summary"><p>Get the direction of the max value.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int MaxDir { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Geom_Vec2i_Min_" data-uid="Hi.Geom.Vec2i.Min*"></a>

  <h3 id="Hi_Geom_Vec2i_Min" data-uid="Hi.Geom.Vec2i.Min">
  Min
  
  </h3>

  <div class="markdown level1 summary"><p>Get min value from {x,y}.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int Min { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>








  <a id="Hi_Geom_Vec2i_NativeByteSize_" data-uid="Hi.Geom.Vec2i.NativeByteSize*"></a>

  <h3 id="Hi_Geom_Vec2i_NativeByteSize" data-uid="Hi.Geom.Vec2i.NativeByteSize">
  NativeByteSize
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static int NativeByteSize { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>Byte size: sizeof(int) * 2.</p>
</dd>
  </dl>








  <a id="Hi_Geom_Vec2i_One_" data-uid="Hi.Geom.Vec2i.One*"></a>

  <h3 id="Hi_Geom_Vec2i_One" data-uid="Hi.Geom.Vec2i.One">
  One
  
  </h3>

  <div class="markdown level1 summary"><p>Generate vec (1,1).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i One { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>(1,1)</p>
</dd>
  </dl>








  <a id="Hi_Geom_Vec2i_UnitX_" data-uid="Hi.Geom.Vec2i.UnitX*"></a>

  <h3 id="Hi_Geom_Vec2i_UnitX" data-uid="Hi.Geom.Vec2i.UnitX">
  UnitX
  
  </h3>

  <div class="markdown level1 summary"><p>Generate vec (1,0).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i UnitX { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>(1,0)</p>
</dd>
  </dl>








  <a id="Hi_Geom_Vec2i_UnitY_" data-uid="Hi.Geom.Vec2i.UnitY*"></a>

  <h3 id="Hi_Geom_Vec2i_UnitY" data-uid="Hi.Geom.Vec2i.UnitY">
  UnitY
  
  </h3>

  <div class="markdown level1 summary"><p>Generate vec (0,1).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i UnitY { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>(0,1)</p>
</dd>
  </dl>








  <a id="Hi_Geom_Vec2i_Zero_" data-uid="Hi.Geom.Vec2i.Zero*"></a>

  <h3 id="Hi_Geom_Vec2i_Zero" data-uid="Hi.Geom.Vec2i.Zero">
  Zero
  
  </h3>

  <div class="markdown level1 summary"><p>Generate vec (0,0).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i Zero { get; }</code></pre>
  </div>





  <h4 class="section">Property Value</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>(0,0)</p>
</dd>
  </dl>








  <h2 class="section" id="methods">Methods
</h2>


  <a id="Hi_Geom_Vec2i_At_" data-uid="Hi.Geom.Vec2i.At*"></a>

  <h3 id="Hi_Geom_Vec2i_At_System_Int32_" data-uid="Hi.Geom.Vec2i.At(System.Int32)">
  At(int)
  
  </h3>

  <div class="markdown level1 summary"><p>Member at direction.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ref int At(int dir)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>dir</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>direction</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>member</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_Cross_" data-uid="Hi.Geom.Vec2i.Cross*"></a>

  <h3 id="Hi_Geom_Vec2i_Cross_Hi_Geom_Vec2i_" data-uid="Hi.Geom.Vec2i.Cross(Hi.Geom.Vec2i)">
  Cross(Vec2i)
  
  </h3>

  <div class="markdown level1 summary"><p>Cross.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int Cross(Vec2i src)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>src</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>cross value</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_Dot_" data-uid="Hi.Geom.Vec2i.Dot*"></a>

  <h3 id="Hi_Geom_Vec2i_Dot_Hi_Geom_Vec2i_" data-uid="Hi.Geom.Vec2i.Dot(Hi.Geom.Vec2i)">
  Dot(Vec2i)
  
  </h3>

  <div class="markdown level1 summary"><p>Dot.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int Dot(Vec2i src)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>src</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>dotted value</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_Equals_" data-uid="Hi.Geom.Vec2i.Equals*"></a>

  <h3 id="Hi_Geom_Vec2i_Equals_Hi_Geom_Vec2i_" data-uid="Hi.Geom.Vec2i.Equals(Hi.Geom.Vec2i)">
  Equals(Vec2i)
  
  </h3>

  <div class="markdown level1 summary"><p>Indicates whether the current object is equal to another object of the same type.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public bool Equals(Vec2i other)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>other</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>An object to compare with this object.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if the current object is equal to the <code class="paramref">other</code> parameter; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>.</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_Equals_" data-uid="Hi.Geom.Vec2i.Equals*"></a>

  <h3 id="Hi_Geom_Vec2i_Equals_System_Object_" data-uid="Hi.Geom.Vec2i.Equals(System.Object)">
  Equals(object)
  
  </h3>

  <div class="markdown level1 summary"><p>Determines whether the specified object is equal to the current object.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override bool Equals(object obj)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>obj</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></dt>
    <dd><p>The object to compare with the current object.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if the specified object  is equal to the current object; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>.</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_GenOne_" data-uid="Hi.Geom.Vec2i.GenOne*"></a>

  <h3 id="Hi_Geom_Vec2i_GenOne" data-uid="Hi.Geom.Vec2i.GenOne">
  GenOne()
  
  </h3>

  <div class="markdown level1 summary"><p>Generate vec (1,1).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i GenOne()</code></pre>
  </div>


  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>(1,1)</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_GenUnitX_" data-uid="Hi.Geom.Vec2i.GenUnitX*"></a>

  <h3 id="Hi_Geom_Vec2i_GenUnitX" data-uid="Hi.Geom.Vec2i.GenUnitX">
  GenUnitX()
  
  </h3>

  <div class="markdown level1 summary"><p>Generate vec (1,0).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i GenUnitX()</code></pre>
  </div>


  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>(1,0)</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_GenUnitY_" data-uid="Hi.Geom.Vec2i.GenUnitY*"></a>

  <h3 id="Hi_Geom_Vec2i_GenUnitY" data-uid="Hi.Geom.Vec2i.GenUnitY">
  GenUnitY()
  
  </h3>

  <div class="markdown level1 summary"><p>Generate vec (0,1).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i GenUnitY()</code></pre>
  </div>


  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>(0,1)</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_GenZero_" data-uid="Hi.Geom.Vec2i.GenZero*"></a>

  <h3 id="Hi_Geom_Vec2i_GenZero" data-uid="Hi.Geom.Vec2i.GenZero">
  GenZero()
  
  </h3>

  <div class="markdown level1 summary"><p>Generate vec (0,0).</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i GenZero()</code></pre>
  </div>


  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>(0,0)</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_GetHashCode_" data-uid="Hi.Geom.Vec2i.GetHashCode*"></a>

  <h3 id="Hi_Geom_Vec2i_GetHashCode" data-uid="Hi.Geom.Vec2i.GetHashCode">
  GetHashCode()
  
  </h3>

  <div class="markdown level1 summary"><p>Serves as the default hash function.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override int GetHashCode()</code></pre>
  </div>


  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>A hash code for the current object.</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_Output_" data-uid="Hi.Geom.Vec2i.Output*"></a>

  <h3 id="Hi_Geom_Vec2i_Output_System_IO_BinaryWriter_" data-uid="Hi.Geom.Vec2i.Output(System.IO.BinaryWriter)">
  Output(BinaryWriter)
  
  </h3>

  <div class="markdown level1 summary"><p>Output to bytes:
writer.Write(x);
writer.Write(y);</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Output(BinaryWriter writer)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>writer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.binarywriter">BinaryWriter</a></dt>
    <dd><p>writer</p>
</dd>
  </dl>












  <a id="Hi_Geom_Vec2i_Set_" data-uid="Hi.Geom.Vec2i.Set*"></a>

  <h3 id="Hi_Geom_Vec2i_Set_Hi_Geom_Vec2i_" data-uid="Hi.Geom.Vec2i.Set(Hi.Geom.Vec2i)">
  Set(Vec2i)
  
  </h3>

  <div class="markdown level1 summary"><p>Set values by copy.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i Set(Vec2i src)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>src</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>this</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_Set_" data-uid="Hi.Geom.Vec2i.Set*"></a>

  <h3 id="Hi_Geom_Vec2i_Set_System_Int32_System_Int32_" data-uid="Hi.Geom.Vec2i.Set(System.Int32,System.Int32)">
  Set(int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Set values.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i Set(int x, int y)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>x</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>x</p>
</dd>
    <dt><code>y</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>y</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>this</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_Set_" data-uid="Hi.Geom.Vec2i.Set*"></a>

  <h3 id="Hi_Geom_Vec2i_Set_System_Int32_System_Int32_System_Int32_" data-uid="Hi.Geom.Vec2i.Set(System.Int32,System.Int32,System.Int32)">
  Set(int, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Set values by direction offset.
Direction 0,1,2 indicate x,y,z respectively.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i Set(int dir, int a, int b)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>dir</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>direction offset</p>
</dd>
    <dt><code>a</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>value at direction (0+dir)%3</p>
</dd>
    <dt><code>b</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>value at direction (1+dir)%3</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>this</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_Set_" data-uid="Hi.Geom.Vec2i.Set*"></a>

  <h3 id="Hi_Geom_Vec2i_Set_System_Int32___" data-uid="Hi.Geom.Vec2i.Set(System.Int32[])">
  Set(int[])
  
  </h3>

  <div class="markdown level1 summary"><p>Set values by array.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i Set(int[] xy)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>xy</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>[]</dt>
    <dd><p>int[]{x,y}</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>this</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_SetEachValueAbs_" data-uid="Hi.Geom.Vec2i.SetEachValueAbs*"></a>

  <h3 id="Hi_Geom_Vec2i_SetEachValueAbs" data-uid="Hi.Geom.Vec2i.SetEachValueAbs">
  SetEachValueAbs()
  
  </h3>

  <div class="markdown level1 summary"><p>Set all member to absolute value.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Vec2i SetEachValueAbs()</code></pre>
  </div>


  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>this</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_ToString_" data-uid="Hi.Geom.Vec2i.ToString*"></a>

  <h3 id="Hi_Geom_Vec2i_ToString" data-uid="Hi.Geom.Vec2i.ToString">
  ToString()
  
  </h3>

  <div class="markdown level1 summary"><p>Returns a string that represents the current object.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override string ToString()</code></pre>
  </div>


  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>A string that represents the current object.</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_ToString_" data-uid="Hi.Geom.Vec2i.ToString*"></a>

  <h3 id="Hi_Geom_Vec2i_ToString_System_String_System_IFormatProvider_" data-uid="Hi.Geom.Vec2i.ToString(System.String,System.IFormatProvider)">
  ToString(string, IFormatProvider)
  
  </h3>

  <div class="markdown level1 summary"><p>Returns a string representation of the vector formatted according to the specified format.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public string ToString(string format, IFormatProvider formatProvider)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>format</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>The format to use for each component</p>
</dd>
    <dt><code>formatProvider</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iformatprovider">IFormatProvider</a></dt>
    <dd><p>The format provider to use</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd><p>A formatted string representation of the vector</p>
</dd>
  </dl>











  <h2 class="section" id="operators">Operators
</h2>


  <a id="Hi_Geom_Vec2i_op_Addition_" data-uid="Hi.Geom.Vec2i.op_Addition*"></a>

  <h3 id="Hi_Geom_Vec2i_op_Addition_Hi_Geom_Vec2i_Hi_Geom_Vec2i_" data-uid="Hi.Geom.Vec2i.op_Addition(Hi.Geom.Vec2i,Hi.Geom.Vec2i)">
  operator +(Vec2i, Vec2i)
  
  </h3>

  <div class="markdown level1 summary"><p>Plus.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i operator +(Vec2i a, Vec2i b)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>a</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>a</p>
</dd>
    <dt><code>b</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>b</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>a+b</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_op_Division_" data-uid="Hi.Geom.Vec2i.op_Division*"></a>

  <h3 id="Hi_Geom_Vec2i_op_Division_Hi_Geom_Vec2i_System_Int32_" data-uid="Hi.Geom.Vec2i.op_Division(Hi.Geom.Vec2i,System.Int32)">
  operator /(Vec2i, int)
  
  </h3>

  <div class="markdown level1 summary"><p>a/d.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i operator /(Vec2i a, int d)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>a</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>a</p>
</dd>
    <dt><code>d</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>d</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>a/d</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_op_Multiply_" data-uid="Hi.Geom.Vec2i.op_Multiply*"></a>

  <h3 id="Hi_Geom_Vec2i_op_Multiply_Hi_Geom_Vec2i_System_Int32_" data-uid="Hi.Geom.Vec2i.op_Multiply(Hi.Geom.Vec2i,System.Int32)">
  operator *(Vec2i, int)
  
  </h3>

  <div class="markdown level1 summary"><p>a*s.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i operator *(Vec2i a, int s)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>a</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>a</p>
</dd>
    <dt><code>s</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>s</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>a*s</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_op_Subtraction_" data-uid="Hi.Geom.Vec2i.op_Subtraction*"></a>

  <h3 id="Hi_Geom_Vec2i_op_Subtraction_Hi_Geom_Vec2i_Hi_Geom_Vec2i_" data-uid="Hi.Geom.Vec2i.op_Subtraction(Hi.Geom.Vec2i,Hi.Geom.Vec2i)">
  operator -(Vec2i, Vec2i)
  
  </h3>

  <div class="markdown level1 summary"><p>a-b.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i operator -(Vec2i a, Vec2i b)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>a</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>a</p>
</dd>
    <dt><code>b</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>b</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>a-b</p>
</dd>
  </dl>











  <a id="Hi_Geom_Vec2i_op_UnaryNegation_" data-uid="Hi.Geom.Vec2i.op_UnaryNegation*"></a>

  <h3 id="Hi_Geom_Vec2i_op_UnaryNegation_Hi_Geom_Vec2i_" data-uid="Hi.Geom.Vec2i.op_UnaryNegation(Hi.Geom.Vec2i)">
  operator -(Vec2i)
  
  </h3>

  <div class="markdown level1 summary"><p>Negate.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Vec2i operator -(Vec2i src)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>src</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Geom.Vec2i.html">Vec2i</a></dt>
    <dd><p>Negate</p>
</dd>
  </dl>












</article>

        <div class="contribution d-print-none">
        </div>


      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top text-secondary">
      <div class="container-xxl">
        <div class="flex-fill">
          <span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
        </div>
      </div>
    </footer>
  </body>
</html>
